package org.come.mouslisten;

import com.tool.PanelDisplay.PetPanelShow;
import com.tool.PanelDisplay.RolePanelShow;
import com.tool.image.Creepsskin;
import com.tool.image.ImageMixDeal;
import com.tool.pet.PetProperty;
import com.tool.role.GetExp;
import com.tool.role.RoleData;
import com.tool.role.RoleProperty;
import come.tool.Fighting.FightingMixDeal;
import come.tool.Fighting.Fightingimage;
import org.apache.commons.lang.StringUtils;
import org.come.Frame.TestPetJframe;
import org.come.Frame.Teststatejframe;
import org.come.Jpanel.MountShouhuJpanel;
import org.come.Jpanel.TestPetJpanel;
import org.come.Jpanel.TeststateJpanel;
import org.come.Jpanel.ZhuJpanel;
import org.come.MountShouHu.ShouhuPackJframe;
import org.come.bean.LoginResult;
import org.come.entity.Mount;
import org.come.entity.RoleSummoning;
import org.come.until.*;

import javax.swing.*;
import java.math.BigDecimal;

/***
 * @author 黄建彬
 * @date : 2018年1月3日 下午7:26:09
 *
 *       召唤兽点数切换
 */
public class PetAddPointMouslisten {
    /**
     * 人物属性添加增加对应的属性
     *
     * @throws Exception
     */
    public static void getplayerValue() {
        Teststatejframe.getTeststatejframe();
        LoginResult loginResult = RoleData.getRoleData().getLoginResult();
        TeststateJpanel teststateJpanel = Teststatejframe.getTeststatejframe().getTeststateJpanel();
        // 判断飞升与否
        int lvltrue = AnalysisString.lvltrue(loginResult.getGrade());
        teststateJpanel.changeSoaringPanel(lvltrue);

        // 设置面板里面的基本参数
        // 种族
        teststateJpanel.getLabrace().setText(loginResult.getRace_name() + "·" + Creepsskin.getLocalName(ImageMixDeal.userimg.getRoleShow().getSpecies_id().intValue()));

        // 设置帮派
        teststateJpanel.getLabgangs().setText(loginResult.getGangname());
        // 称谓
        teststateJpanel.getLabappellation().setText(loginResult.getTitle());
        // 名字
        teststateJpanel.getLabrolename().setText(loginResult.getRolename());
        // id
        if(StringUtils.isNotEmpty(loginResult.getLiangHao())){
            teststateJpanel.getLabappeleid().setText("");
        }else{
            teststateJpanel.getLabappeleid().setText(loginResult.getRole_id() + "");
        }
        // 设置头像
        teststateJpanel.getLabrolehead().setIcon(
                CutButtonImage.getImage("img/head/" + loginResult.getSpecies_id() + ".png", -1, -1));
        // 设置声望
        teststateJpanel.getLabprestige().setText(loginResult.getPrestige().toString());
        // 设置战绩
        teststateJpanel.getLabrecord().setText(loginResult.getPkrecord().toString());
        // 设置等级
        RolePanelShow.changeRoleGrade(loginResult.getGrade());
        // 设置经验
        // 飞升与不飞升有区别
        if (lvltrue <= 3) {
            String curr = loginResult.getExperience().toString();
            String max = RolePanelShow.accessMaxValue(loginResult.getGrade()).toString();

            curr = curr.length() > 7 ? curr.substring(0, curr.length() - 3) + "K" : curr;
            max = max.length() > 7 ? max.substring(0, max.length() - 3) + "K" : max;

            teststateJpanel.getLabEXP().setText(curr + "/"+ max);
        } else {
            teststateJpanel.getLabEXP().setText(loginResult.getExperience().toString());
        }
        // 可分配点数
        teststateJpanel.getLabpointnumber().setText(loginResult.getCanpoint().toString());
        RoleProperty property = RoleProperty.property;
        if (property == null) {
            return;
        }
        // 根骨输入框
        teststateJpanel.getLabrootbone().setText(RoleProperty.getBone(loginResult) + "");
        // 灵性输入框
        teststateJpanel.getLabintelligence().setText(RoleProperty.getSpir(loginResult) + "");
        // 力量输入框
        teststateJpanel.getLabpower().setText(RoleProperty.getPower(loginResult) + "");
        // 敏捷输入框
        teststateJpanel.getLabspeed().setText(RoleProperty.getSpeed(loginResult) + "");
        // 定力输入框
        teststateJpanel.getLabability().setText(RoleProperty.getCalm(loginResult) + "");
        int z=0;
        if (ImageMixDeal.userimg.getRoleShow().getFighting()!=0){
            for (Fightingimage fightingimage: FightingMixDeal.CurrentData){
                if (fightingimage.getFightingManData().getManname().equals(ImageMixDeal.userimg.getRoleShow().getRolename())){
                    z=fightingimage.getFightingManData().getHp_Total();
                }
            }
        }else {
            z = RoleProperty.getHp(RoleData.getRoleData().getLoginResult());
        }

       //
        // 设置hp
        teststateJpanel.getLabHP().setText( loginResult.getHp().intValue()+ "/" + z);//RoleProperty.getHp(loginResult)
        // 设置mp
        teststateJpanel.getLabMP().setText(loginResult.getMp().intValue() + "/" + RoleProperty.getMp(loginResult));
        // 设置ap
        teststateJpanel.getLabAP().setText(RoleProperty.getAp(loginResult) + "");
        // 设置sp
        teststateJpanel.getLabSP().setText(RoleProperty.getSp(loginResult) + "");
        // 设置cp(定力)
        teststateJpanel.getLabCP().setText(RoleProperty.getCdz(loginResult) + "");
        // 血条
        Article.manxie(loginResult);

    }


    public static void getplayerValue1() {
        Teststatejframe.getTeststatejframe();
        LoginResult loginResult = RoleData.getRoleData().getLoginResult();
        TeststateJpanel teststateJpanel = Teststatejframe.getTeststatejframe().getTeststateJpanel();
        // 判断飞升与否
        int lvltrue = AnalysisString.lvltrue(loginResult.getGrade());
        teststateJpanel.changeSoaringPanel(lvltrue);

        // 设置面板里面的基本参数
        // 种族
        teststateJpanel.getLabrace().setText(loginResult.getRace_name());
        // 设置帮派
        teststateJpanel.getLabgangs().setText(loginResult.getGangname());
        // 称谓
        teststateJpanel.getLabappellation().setText(loginResult.getTitle());
        // 名字
        teststateJpanel.getLabrolename().setText(loginResult.getRolename());
        // id
        teststateJpanel.getLabappeleid().setText(loginResult.getRole_id() + "");
        // 设置头像
        teststateJpanel.getLabrolehead().setIcon(
                CutButtonImage.getImage("img/head/" + loginResult.getSpecies_id() + ".png", -1, -1));
        // 设置声望
        teststateJpanel.getLabprestige().setText(loginResult.getPrestige().toString());
        // 设置战绩
        teststateJpanel.getLabrecord().setText(loginResult.getPkrecord().toString());
        // 设置等级
        RolePanelShow.changeGrade(loginResult.getGrade());
        // 设置经验
        // 飞升与不飞升有区别
        if (lvltrue <= 3) {
            String curr = loginResult.getExperience().toString();
            String max = RolePanelShow.accessMaxValue(loginResult.getGrade()).toString();

            curr = curr.length() > 7 ? curr.substring(0, curr.length() - 3) + "K" : curr;
            max = max.length() > 7 ? max.substring(0, max.length() - 3) + "K" : max;

            teststateJpanel.getLabEXP().setText(curr + "/"+ max);
        } else {
            teststateJpanel.getLabEXP().setText(loginResult.getExperience().toString());
        }
        // 可分配点数
        teststateJpanel.getLabpointnumber().setText(loginResult.getCanpoint().toString());
        RoleProperty property = RoleProperty.property;
        if (property == null) {
            return;
        }
        // 根骨输入框
        teststateJpanel.getLabrootbone().setText(RoleProperty.getBone(loginResult) + "");
        // 灵性输入框
        teststateJpanel.getLabintelligence().setText(RoleProperty.getSpir(loginResult) + "");
        // 力量输入框
        teststateJpanel.getLabpower().setText(RoleProperty.getPower(loginResult) + "");
        // 敏捷输入框
        teststateJpanel.getLabspeed().setText(RoleProperty.getSpeed(loginResult) + "");
        // 定力输入框
        teststateJpanel.getLabability().setText(RoleProperty.getCalm(loginResult) + "");
        // 设置hp
        teststateJpanel.getLabHP().setText(loginResult.getHp().intValue() + "/" + RoleProperty.getHp(loginResult));
        // 设置mp
        teststateJpanel.getLabMP().setText(loginResult.getMp().intValue() + "/" + RoleProperty.getMp(loginResult));
        // 设置ap
        teststateJpanel.getLabAP().setText(RoleProperty.getAp(loginResult) + "");
        // 设置sp
        teststateJpanel.getLabSP().setText(RoleProperty.getSp(loginResult) + "");
        // 设置cp(定力)
        teststateJpanel.getLabCP().setText(RoleProperty.getCdz(loginResult) + "");
    }

    /**
     * 召唤兽增加对应的属性
     */
    public static void getPetValue() {
        // 刷新面板
        showPetValue();
    }

    public static void showPetValue() {
        showPetValue(true);
    }

    /**
     * 进行召唤兽根骨属性面板刷新
     */
    public static void showPetValue(boolean showHead) {
        RoleSummoning pet = UserMessUntil.getChosePetMes();
        if (pet != null) {
            // 属性
            int[] pets = PetProperty.getPetHMASp(pet);
            TestPetJpanel.getLabHP().setText(pet.getBasishp() + "/" + pets[0]);
            TestPetJpanel.getLabMP().setText(pet.getBasismp() + "/" + pets[1]);
            TestPetJpanel.getLabAP().setText(pets[2] + "");
            TestPetJpanel.getLabSP().setText(pets[3] + "");
            TestPetJpanel.getLabCP().setText(pets[4] + "");
            // 设置对应的根骨灵性
            TestPetJpanel.getLabrootbone().setText(pet.getZBone() + "");
            TestPetJpanel.getLabintelligence().setText(pet.getZSpir() + "");
            TestPetJpanel.getLabpower().setText(pet.getZPower() + "");
            TestPetJpanel.getLabspeed().setText(pet.getZSpeed() + "");
            TestPetJpanel.getLabconcentrate().setText(pet.getZCalm() + "");
            // 可分配点数
            TestPetJpanel.getLabpointnumber().setText(pet.getCanpoint() + "");

            String curr = pet.getExp().toString();
            String max = GetExp.getBBExp(pet.getTurnRount(), AnalysisString.petLvlint(pet.getGrade())) + "";

            curr = curr.length() > 7 ? curr.substring(0, curr.length() - 3) + "K" : curr;
            max = max.length() > 7 ? max.substring(0, max.length() - 3) + "K" : max;


            TestPetJpanel.getLabEXP().setText(curr + "/" + max);
            // 忠诚
            TestPetJpanel.getLabloyalty().setText(pet.getFaithful().toString());
            // 亲密
            TestPetJpanel.getLabclose().setText(pet.getFriendliness() + "");
            // 等级
            PetPanelShow.changePetGrade(pet.getGrade(), pet.getSummoningname());
            // 刷新血条
            if (showHead) {
                Article.souxie(pet);
            }
            // 判断选中的召唤兽是不是携带的召唤兽
            if (RoleData.getRoleData().getLoginResult().getSummoning_id() != null) {
                // 有携带的召唤兽
                if ((RoleData.getRoleData().getLoginResult().getSummoning_id().compareTo(UserMessUntil.getChosePetMes().getSid())) == 0) {
                    TestPetJpanel.getTestPetJpanel().getBtnwar().setText("休息");
                    TestPetJpanel.getTestPetJpanel().getBtnwar().setTypeBtn(3);
                } else {
                    TestPetJpanel.getTestPetJpanel().getBtnwar().setText("参战");
                    TestPetJpanel.getTestPetJpanel().getBtnwar().setTypeBtn(2);
                }
                //1级展示灵犀技能骑着老鼠的猫
                if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getTurnRount() >= 4) {
                    TestPetJpanel.getTestPetJpanel().getLingxi().setVisible(true);
                } else {
                    TestPetJpanel.getTestPetJpanel().getLingxi().setVisible(false);
                }
            }
            // 将内丹也展示出来
            // 判断这只召唤兽是否有内丹
            if (pet.getInnerGoods() != null && !"".equals(pet.getInnerGoods())) {// 有
                String[] strings = pet.getInnerGoods().split("\\|");
                for (int i = 0; i < 3; i++) {
                    TestPetJpanel.getLabNedan()[i].setGoodstable(null);
                    TestPetJframe.getTestPetJframe().getTestPetJpanel().remove(TestPetJpanel.getLabNedan()[i]);
                }
                if (strings.length > 0) {
                    for (int i = 0; i < strings.length; i++) {
                        // 将内丹物品放进去监听中
                        TestPetJframe.getTestPetJframe().getTestPetJpanel().add(TestPetJpanel.getLabNedan()[i]);
                        TestPetJpanel.getLabNedan()[i].setGoodstable(GoodsListFromServerUntil.fushis
                                .get(new BigDecimal(strings[i])));
                    }
                }
            } else {// 没有
                for (int i = 0; i < 3; i++) {
                    TestPetJpanel.getLabNedan()[i].setGoodstable(null);
                    TestPetJframe.getTestPetJframe().getTestPetJpanel().remove(TestPetJpanel.getLabNedan()[i]);
                }
            }
        }
    }

    /**
     * 清空界面
     */
    public static void clearWindow() {
        TestPetJpanel.getLabname().setText("");
        // 属性
        TestPetJpanel.getLabHP().setText("");
        TestPetJpanel.getLabMP().setText("");
        TestPetJpanel.getLabAP().setText("");
        TestPetJpanel.getLabSP().setText("");
        // 设置对应的根骨灵性
        TestPetJpanel.getLabrootbone().setText("");
        TestPetJpanel.getLabintelligence().setText("");
        TestPetJpanel.getLabpower().setText("");
        TestPetJpanel.getLabspeed().setText("");
        // 可分配点数
        TestPetJpanel.getLabpointnumber().setText("");
        TestPetJpanel.getLabEXP().setText("");
        // 忠诚
        TestPetJpanel.getLabloyalty().setText("");
        // 等级
        TestPetJpanel.getLablevel().setText("");
        // 内丹
        for (int i = 0; i < 3; i++) {
            TestPetJpanel.getLabNedan()[i].setGoodstable(null);
            TestPetJframe.getTestPetJframe().getTestPetJpanel().remove(TestPetJpanel.getLabNedan()[i]);
        }
    }

    /**
     * 当前等级换算
     */
    public static int newgrade(int grade) {
        int newgrade = 0;// 判断人物的等级
        if (grade <= 102) {
            newgrade = grade;
        } else if (grade > 102 && grade <= 210) {
            newgrade = grade - 102 + 14;
        } else if (grade > 210 && grade <= 338) {
            newgrade = grade - 210 + 14;
        } else if (grade > 338 && grade <= 504) {
            newgrade = grade - 338 + 14;
        } else if (grade > 504) {
            newgrade = grade - 504 + 14;
        }
        return newgrade;
    }

    /**
     * 进行确认加点
     *
     * @throws Exception
     */
    public static void sureGetPlayerPoint() {
        // getplayerValue();
        // 刷新装备属性
        RoleProperty.getRoleProperty().equipWearOff();
    }
    public static java.lang.Object[] value(String value,int mountid){
        LoginResult loginResult=RoleData.getRoleData().getLoginResult();
        final Object[][] attackValues = {{0, 0.0}};
        final int[] l = {0};
        final double[] p = {0.0};
        double qiong=1.0;
        double baihu=1.0;
        double xuanwu=1.0;
        double zhuque=1.0;
        DefaultListModel<String> shuxingmodel=new DefaultListModel<>();
        if (loginResult.getJiesuo()!=null){
            if (loginResult.getJiesuo().contains(mountid+"")){
                shuxingmodel.addElement("1级 青龙守护属性提升10%");
                shuxingmodel.addElement("2级 白虎守护属性提升10%");
                shuxingmodel.addElement("3级 朱雀守护属性提升10%");
                shuxingmodel.addElement("4级 玄武守护属性提升10%");
                shuxingmodel.addElement("5级 青龙守护属性提升15%");
                shuxingmodel.addElement("6级 白虎守护属性提升15%");
                shuxingmodel.addElement("7级 朱雀守护属性提升15%");
                shuxingmodel.addElement("8级 玄武守护属性提升15%");
                shuxingmodel.addElement("9级 青龙守护属性提升15%");
                shuxingmodel.addElement("10级 白虎守护属性提升15%");
                shuxingmodel.addElement("11级 朱雀守护属性提升15%");
                shuxingmodel.addElement("12级 玄武守护属性提升15%");
                shuxingmodel.addElement("13级 青龙守护属性提升20%");
                shuxingmodel.addElement("14级 白虎守护属性提升20%");
                shuxingmodel.addElement("15级 朱雀守护属性提升20%");
                shuxingmodel.addElement("16级 玄武守护属性提升20%");
                shuxingmodel.addElement("17级 青龙守护属性提升20%");
                shuxingmodel.addElement("18级 白虎守护属性提升20%");
                shuxingmodel.addElement("19级 朱雀守护属性提升20%");
                shuxingmodel.addElement("20级 玄武守护属性提升20%");
                shuxingmodel.addElement("21级 青龙守护属性提升20%");
                shuxingmodel.addElement("22级 白虎守护属性提升20%");
                shuxingmodel.addElement("23级 朱雀守护属性提升20%");
                shuxingmodel.addElement("24级 玄武守护属性提升20%");
                int k = Math.min(Integer.parseInt(loginResult.getZhongtian().split("\\|")[0]), 24);
                int q = 0;
                int b = 0;
                int x = 0;
                int z = 0;
                for (int i = 0; i <= k - 1; i++) {
                    if (shuxingmodel.elementAt(i).contains("青龙")) {
                        char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
                        char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
                        q = q + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));

                    } else if (shuxingmodel.elementAt(i).contains("白虎")) {
                        char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
                        char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
                        b = b + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
                    }
                    if (shuxingmodel.elementAt(i).contains("朱雀")) {
                        char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
                        char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
                        z = z + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
                    }
                    if (shuxingmodel.elementAt(i).contains("玄武")) {
                        char secondLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 3);
                        char thirdLastChar = shuxingmodel.elementAt(i).charAt(shuxingmodel.elementAt(i).length() - 2);
                        x = x + Integer.parseInt(String.valueOf(secondLastChar)) * 10 + Integer.parseInt(String.valueOf(thirdLastChar));
                    }
                }
                qiong+=q/100.0;
                baihu+=b/100.0;
                xuanwu+=x/100.0;
                zhuque+=z/100.0;
            }
        }
        shuxingmodel.clear();
        double finalQiong = qiong;
        double finalBaihu = baihu;
        double finalXuanwu = xuanwu;
        double finalZhuque = zhuque;
        UserMessUntil.getMountlsit().forEach(e->{
            if (e.getMountid()==mountid){
                switch (e.getSh()){
                    case 1:
                        for (int i = 0; i <= MountShouhuJpanel.shuxingmap.get("青龙").size() - 1; i++) {
                            shuxingmodel.addElement(MountShouhuJpanel.shuxingmap.get("青龙").get(i));
                        }
                        if (loginResult.getQinglong()!=null){
                            attackValues[0] = MountShouhuJpanel.calculateTotalAttackValue(shuxingmodel, Integer.parseInt(loginResult.getQinglong().split("\\|")[0]), value);
                            l[0] = (int) (l[0] +(int) attackValues[0][0]* finalQiong);
                            p[0] = p[0] +(double) attackValues[0][1]* finalQiong;
                        }
                        break;
                    case 2:
                        for (int i = 0; i <= MountShouhuJpanel.shuxingmap.get("白虎").size() - 1; i++) {
                            shuxingmodel.addElement(MountShouhuJpanel.shuxingmap.get("白虎").get(i));
                        }
                        if (loginResult.getBaihu()!=null){
                            attackValues[0] = MountShouhuJpanel.calculateTotalAttackValue(shuxingmodel, Integer.parseInt(loginResult.getBaihu().split("\\|")[0]), value);
                            l[0] = (int) (l[0] +(int) attackValues[0][0]* finalBaihu);
                            p[0] = p[0] +(double) attackValues[0][1]* finalBaihu;
                        }
                        break;
                    case 3:
                        for (int i = 0; i <= MountShouhuJpanel.shuxingmap.get("玄武").size() - 1; i++) {
                            shuxingmodel.addElement(MountShouhuJpanel.shuxingmap.get("玄武").get(i));
                        }
                        if (loginResult.getXuanwu()!=null){
                            attackValues[0] = MountShouhuJpanel.calculateTotalAttackValue(shuxingmodel, Integer.parseInt(loginResult.getXuanwu().split("\\|")[0]), value);
                            l[0] = (int) (l[0] +(int) attackValues[0][0]* finalXuanwu);
                            p[0] = p[0] +(double) attackValues[0][1]* finalXuanwu;
                        }
                        break;
                    case 4:
                        for (int i = 0; i <= MountShouhuJpanel.shuxingmap.get("朱雀").size() - 1; i++) {
                            shuxingmodel.addElement(MountShouhuJpanel.shuxingmap.get("朱雀").get(i));
                        }
                        if (loginResult.getZhuque()!=null){
                            attackValues[0] = MountShouhuJpanel.calculateTotalAttackValue(shuxingmodel, Integer.parseInt(loginResult.getZhuque().split("\\|")[0]), value);
                            l[0] = (int) (l[0] +(int) attackValues[0][0]* finalZhuque);
                            p[0] = p[0] +(double) attackValues[0][1]* finalZhuque;
                        }
                        break;
                }
            }
        });

        attackValues[0][0]= l[0];
        attackValues[0][1]= p[0];
        return attackValues[0];
    }
    public static int[] shouhuvalue(int []pets,RoleSummoning pet){

        LoginResult loginResult=RoleData.getRoleData().getLoginResult();
        int m = 0;
        while (m < ZhuJpanel.getListMount().size()){
            final Mount mount = (Mount)ZhuJpanel.getListMount().get(m);
            if (mount.isID(pet.getSid())){
                if (mount.getSh()!=0){//loginResult.getJiesuo()!=null&&loginResult.getJiesuo().contains(mount.getMountid()+"")
                    Object[] attackValues= value("气血",mount.getMountid());
                    Object[] attackValues1= value("法力",mount.getMountid());
                    Object[] attackValues2= value("攻击",mount.getMountid());
                    Object[] attackValues3= value("速度",mount.getMountid());
                    pets[0]+=(int)attackValues[0];
                    pets[0]+=(double)attackValues[1]/100*pets[0];
                    pets[1]+=(int)attackValues1[0];
                    pets[1]+=(double)attackValues1[1]/100*pets[1];
                    pets[2]+=(int)attackValues2[0];
                    pets[2]+=(double)attackValues2[1]/100*pets[2];
                    pets[3]+=(int)attackValues3[0];
                    pets[3]+=(double)attackValues3[1]/100*pets[3];
                    if (mount.getShouhu()!=0){

                        ShouhuPackJframe.getShouhuPackJframe().getShouhuPackJpanel().Eqment.forEach(P->{
                            if (P.getRgid().intValue()==mount.getShouhu()){
                                if (P.getValue()!=null&&!P.getValue().equals("")){
                                    String[] mes =P.getValue().split("\\|");
                                    for (int i=1;i<=mes.length-1;i++){
                                        if (mes[i].split("=")[0].contains("气血")){
                                            pets[0]+=Double.parseDouble(mes[i].split("=")[1]);
                                        }else if (mes[i].split("=")[0].contains("魔法")){
                                            pets[1]+=Double.parseDouble(mes[i].split("=")[1]);
                                        }else if (mes[i].split("=")[0].contains("攻击")){
                                            pets[2]+=Double.parseDouble(mes[i].split("=")[1]);
                                        }else if (mes[i].split("=")[0].contains("速度")){
                                            pets[3]+=Double.parseDouble(mes[i].split("=")[1]);
                                        }else if (mes[i].split("=")[0].matches("\\d+")&&UserMessUntil.getSkillId(mes[i].split("=")[0])!=null&&mes[i].split("=")[0].equals("4002")){
                                            int n= (int) (pets[1]*Integer.parseInt(mes[i].split("=")[1])*6/15.0/100);
                                            pets[2]+=Math.min(n,15000);

                                        }
                                    }
                                }
                            }
                        });
                    }
                }
            }
            m++;
        }
        return pets;
    }
}
